package com.yjps.system.model;

import com.yjps.common.model.BaseModel;

import javax.persistence.*;

/**
 * Created by pcc on 2015/7/12.
 */
@Entity
@Table(name = "t_permission")
public class Permission extends BaseModel{

    @Column(name = "permission")
    private String permissionName;
    @Column(name = "permission_description")
    private String per_description;
    @Column(name = "permission_state",columnDefinition="INT default 1")
    private int perState;
    private Role role;
    @ManyToOne(targetEntity = Role.class)
    @JoinTable(name="role_permission",joinColumns = {@JoinColumn(name="permission_id")},inverseJoinColumns = {@JoinColumn(name="role_id")})
    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getPer_description() {
        return per_description;
    }

    public void setPer_description(String per_description) {
        this.per_description = per_description;
    }

    public int getPerState() {
        return perState;
    }

    public void setPerState(int perState) {
        this.perState = perState;
    }
}
